{extend name="default/base/base_fuwu" /}
{block name="fuwu_main"}
<div class="dssc-form-default">
    <form method="post"  enctype="multipart/form-data" id="fuwu_form"  onsubmit="ds_ajaxpost('fuwu_form','url','{:url('fuwu_manage_account/edit_password')}');return false;" >
        
        
        
        <dl>
            <dt>新密码{$Think.lang.ds_colon}</dt>
            <dd>
                <input class="w200 text" name="password1" type="password" />
            </dd>
        </dl>
        <dl>
            <dt>确认密码{$Think.lang.ds_colon}</dt>
            <dd>
                <input class="w200 text" name="password2" type="password" />
            </dd>
        </dl>
        <dl>
            <dt>验证码{$Think.lang.ds_colon}</dt>
            <dd>
                <input class="w70 text" name="verify_code" type="text" />
                <a href="javascript:void(0);" id="send_auth_code" class="dssc-btn dssc-btn-acidblue w40">发送</a>
            </dd>
        </dl>
        <div class="bottom">
            <input type="submit" class="submit" value="{$Think.lang.ds_common_button_save}" />
        </div>
    </form>
</div>

<script>
    var num=60
    var timer
    var ALLOW_SEND=true
    function StepTimes() {
        num=60;
        timer=setInterval(function(){
            num = num - 1;
            if (num <= 0) {
                ALLOW_SEND = !ALLOW_SEND;
                $('#send_auth_code').text('发送');
                clearInterval(timer);
            }else{
                $('#send_auth_code').text(num+'s');
            }
        },1000)
    }
    $(function(){
        $('#send_auth_code').on('click', function() {
            if (!ALLOW_SEND)
                return;
            ALLOW_SEND = !ALLOW_SEND;
            $.getJSON("{:url('fuwu_manage_account/send_verify_code')}", {verify_code_type: 3}, function(data) {
                if (data.code == 10000) {
                    StepTimes();
                } else {
                    ALLOW_SEND = !ALLOW_SEND;
                    layer.msg(data.message);
                }
            });
        });
    })
</script>
{/block}
